/*
 * author : Dinh Ngoc Tuan Vu (A0092633)
 */
package sg.edu.nus.iss.team4ft.service;

import java.io.IOException;
import java.io.Serializable;
import java.util.Date;

import sg.edu.nus.iss.team4ft.util.AppConstant;

public class CallTransfer extends Feature  implements Serializable  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public CallTransfer(Date startDate, Plan plan) throws IOException {
		super(startDate, FeatureCode.CallTransfer);
		
		super.setServiceName(AppConstant.CALL_TRANSFER_FEATURE);
		setPlan(plan);
		if(getPlan() != null)
		{
			Double d = 0.0;
			try {
				d = new RateTable().getSubscriptionCharge(getPlan().getPlanCode(), FeatureCode.CallTransfer);
			} catch (IOException e) {
				throw e;
			}
			setSubscriptionCharge(d);
		}
	}
	
	private CallTransfer(CallTransfer callTransfer) throws CloneNotSupportedException {
		super(callTransfer);
	}

	@Override
	public CallTransfer clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return new CallTransfer(this);
	}

}
